
<select name="year<%=idxnum%>" onchange="getDates(<%=idxnum%>)" >
							<script language="javascript" type="text/javascript">

						          var date=new Date();
								  var year=date.getYear();
								  for(var i=year+2;i>=year-4;i--){
								     <%if (mapValue.get("year") == null) {%>
								        if (i==year){
								        	document.write("<option selected value="+i+">"+i+"</option>");
								        }else{
								  	     	document.write("<option value="+i+">"+i+"</option>");
								  	     } 
								     <%}else {%>    
								        if (i==<%=mapValue.get("year")%>){
								        	document.write("<option selected value="+i+">"+i+"</option>");
								        }else{
								  	     	document.write("<option value="+i+">"+i+"</option>");
								  	     }
								  	 <%}%>    
								  }
								  function  append(o,v){
								  	  var option=document.createElement("option");
									  option.value=v;
									  option.innerText=v;
									  o.appendChild(option);
								  }
		  
								  function  getDates(idxnum){
								  	   
								  	   var y=document.getElementsByName("year"+idxnum)[0].value;
									   var m=document.getElementsByName("month"+idxnum)[0].value;
									   
									   var day=document.getElementsByName("day"+idxnum)[0];
									   day.innerHTML="";
									   
									   if(m==1 || m==3 || m==5 || m==7 || m==8 || m==10 || m==12){
									   		for(var j=1;j<=31;j++){
									   				append(day,j);
											}
									   }
									   else if(m==4 || m==6 || m==9 || m==11){
									   	    for(var j=1;j<=30;j++){
									   			    append(day,j);
											}
									   }
									   else if(m==2){
											var flag=true;
											flag=y%4==0&&y%100!=0||y%400==0;
									   		if(flag){
												 for(var j=1;j<=29;j++){
												   append(day,j);
												 }
											}
											else{
												 for(var j=1;j<=28;j++){
									   				append(day,j);
												 }
											}
									   }
									var objdate =eval("document.cform.detaildate"+idxnum);
									objdate.value = document.getElementsByName("year"+idxnum)[0].value +'-'+ document.getElementsByName("month"+idxnum)[0].value+'-'+ document.getElementsByName("day"+idxnum)[0].value;
									
									
									
								  }
						</script>
</select>
						
<select name="month<%=idxnum%>" onchange="getDates(<%=idxnum%>)">
						<script language="javascript" type="text/javascript">
								  for(var i=1;i<=12;i++){
								<%if(mapValue.get("month") == null) {%>
								        if (i==6){
								        	document.write("<option selected value="+i+">"+i+"</option>");
								        }else{
								  	    	document.write("<option value="+i+">"+i+"</option>");
									  	}   
									  	
								<%}else{%>	  	
									if (i==<%=mapValue.get("month")%>){
								        	document.write("<option selected value="+i+">"+i+"</option>");
								        }else{
								  	    	document.write("<option value="+i+">"+i+"</option>");
									  	} 
								
								
								<%}%> 	
								  }
						</script>
</select>
						
<select name="day<%=idxnum%>" onchange="setDates(<%=idxnum%>)">
		<script language="javascript" type="text/javascript">
		
									  for(var i=1;i<=31;i++){
									  	if (i==<%=mapValue.get("day")%>){
									  	    document.write("<option selected value="+i+">"+i+"</option>");
									  	}else{
									  		document.write("<option  value="+i+">"+i+"</option>");
									  	}    
									  }
									  
									  function  setDates(idxnum){
								  	  	var objdate =eval("document.cform.detaildate"+idxnum);
										objdate.value = document.getElementsByName("year"+idxnum)[0].value +'-'+ document.getElementsByName("month"+idxnum)[0].value+'-'+ document.getElementsByName("day"+idxnum)[0].value;
								
								  	  }
		</script>
</select>
						
				